import ajax from '@/common/ajax.js'

// 是否已经是登陆用户
export const userLoginApi = function (data) {
    return ajax.post({
        url: '/api/login/mpWeixinLogin',
        data: data
    })
}

// 注册用户
export const mpWeixinRegisterAndLogin = function (data) {
    return ajax.post({
        url: '/api/login/mpWeixinRegisterByProfileAndLogin',
        data: data
    })
}

//新接口得到电话
export const getPhoneNumber = function (data) {
    return ajax.get({
        url: '/api/login/getPhoneByCode',
        data: data
    })
}

export const setPhoneNumber = function (data) {
    return ajax.get({
        url: '/api/user/setMobile',
        data: data
    })
}

// 退出
export const logout = function (data) {
    return ajax.post({
        url: '/api/user/logout',
        data: data
    })
}

// 绑定手机
export const bindMobile = function (data) {
    return ajax.post({
        url: '/api/user/bindMobile',
        data: data
    })
}

export const profile = function (data) {
    return ajax.post({
        url: '/api/user/profile',
        data: data
    })
}

export const idcard = function (data) {
    return ajax.post({
        url: '/api/user/idcard',
        data: data
    })
}

export const getUserInfo = function (data) {
    return ajax.post({
        url: '/api/user/getInfo',
        data: data
    })
}

// 任务签到列表
export const getDateList = function (data) {
    return ajax.post({
        url: '/api/user/getDateList',
        data: data
    })
}

// 任务签到详情
export const getDateInfo = function (data) {
    return ajax.post({
        url: '/api/user/getDateInfo',
        data: data
    })
}
// 任务签到详情
export const setLog = function (data) {
    return ajax.post({
        url: '/api/user/setLog',
        data: data
    })
}

// 得到用户的第三方人脸核身的二维码
export const faceQrcode = function () {
    return ajax.get({
		url: '/api/user/faceQrcode'
	})
}

export default {
	userLoginApi,
	mpWeixinRegisterAndLogin,
	getPhoneNumber,
	logout,
	bindMobile,
    setPhoneNumber,
    profile,
    idcard,
    getUserInfo,
    getDateList,
    getDateInfo,
    setLog,
	faceQrcode,
}